import React, { Component } from 'react'
import { Form, Input, } from 'antd';


export default class UpdateForm extends Component {
  myForm = React.createRef()
  UNSAFE_componentWillMount () {
    this.props.getform (this.myForm)
  }
  

  render () {
    // 解构props
    // const {categoryItemName} = this.props  initialValues无法解决动态更新显示的问题 用setFieldValues
    return (
      <Form
      layout="vertical"
      name="form_in_modal"
      ref={this.myForm}
      // initialValues={{
      //   categoryName: categoryItemName,
      // }}
    >

      <Form.Item 
      name="categoryName" 
      rules={[
        {
          required: true,
          message: '分类名必须输入，不能为空',
        },
      ]}
      >
        <Input  placeholder='请输入分类名' />
      </Form.Item>
    </Form>
    )
  }
   

  
}
